<template>
    <div>
      <el-card>
        <h3>用户模型</h3>
      </el-card>
      <el-card>
        <div>
          <el-form :inline="true" :model="UplineRecord">
           
            <!-- <el-form-item label="文件名:">
              <el-input v-model="UplineRecord.RecordName" placeholder="用户ID/账号" clearable></el-input>
            </el-form-item> -->
            <el-form-item>
              <el-button type="primary" @click="QueryNoUser">查询</el-button>
            </el-form-item>
            <el-form-item>
              <el-button @click="Resetting">重置</el-button>
            </el-form-item>
          </el-form>
        </div>
        <el-table :data="RecordList" style="width: 100%">
          <el-table-column prop="createTime" label="日期" width="180">
          </el-table-column>
          <el-table-column prop="username" label="账号" width="180">
          </el-table-column>
          <el-table-column prop="modelName" label="模型名称">
          </el-table-column>
          <el-table-column prop="modelKey" label="模型key">
          </el-table-column>

          <el-table-column prop="price" label="模型价格">
          </el-table-column>
          <el-table-column prop="enable" label="是否启用">
                    <template slot-scope="scope">
                        <el-switch v-model="scope.row.enable" disabled>
                        </el-switch>
                    </template>
                </el-table-column>
        </el-table>
      </el-card>
    </div>
  </template>
  
  <script>
  import {QueryModelkey} from '@/api/table'
  export default {
    data() {
      return {
        RecordList: [],
        UplineRecord: {
          RecordName: '',
        },
        page:1,
        size:10,
      };
    },
    created(){
        this.QueryNoUser()
    },
    methods: {
        //查询
        async QueryNoUser(){
           
          QueryModelkey().then(res => {
                this.RecordList = res.data
                console.log(res)
            })
        },



      // 清空每一项的值
      clearObject(obj) {
        for (let key in obj) {
          if (obj.hasOwnProperty(key)) {
            obj[key] = '';
          }
        }
      },
  
  
  
  
      // 重置
      Resetting(){
        this.clearObject(this.UplineRecord)
        this.QueryNoUser()
      }
    },
  };
  </script>
  
  <style lang="scss" scoped></style>
  